How do you set the window state of a DB?
void DoSetMaxClick(DB oDB) {
print("????\n")
}
void DoIsMaxClick(DB oDB) {
print("Max: " (isMaximized(oDB)) "\n")
}
DB oDB = create("Title")
apply(oDB, "SetMax", DoSetMaxClick)
apply(oDB, "IsMax", DoIsMaxClick)
show(oDB)
SystemAdmin - Thu Feb 28 07:23:15 EST 2013 |
Re: DB window state
I don't see anything.
DB db
void buttonSize(DBE dbexx)
{
int w = 0, h = 0
getSize(db, w, h)
print w "x" h "\t"
if (w < 200) //
then setSize(db, 2000, 3000)
else setSize(db, 100, 200)
}
db = create("Resize")
button(db, "Resize", buttonSize)
show(db)
|
Re: DB window state Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: DB window state Mathias Mamsch - Fri Mar 01 04:13:31 EST 2013 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS I have quite a large, resizeable DB which is used quite often. Most people immediatly maximise it. It would have been nice to auto maximise the DB on loading it because offsite users with laptops have a much lower resolution screen, and so just setting the size means it overflows the screen. |
Re: DB window state SystemAdmin - Fri Mar 01 05:47:08 EST 2013 -Louie |
Re: DB window state llandale - Sat Mar 02 17:09:21 EST 2013
Googling brought up the following command: cmd /c wmic desktopmonitor get screenheight, screenwidth
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: DB window state Mathias Mamsch - Sun Mar 03 14:47:33 EST 2013
Googling brought up the following command: cmd /c wmic desktopmonitor get screenheight, screenwidth
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|
Re: DB window state llandale - Mon Mar 04 12:45:16 EST 2013 http://stackoverflow.com/questions/7967699/get-screen-resolution-using-wmi-powershell-in-windows-7 but yeah, could be a possibility. Regards, Mathias Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: DB window state Mathias Mamsch - Mon Mar 04 17:00:00 EST 2013 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
My preferred approach would be to use COM, but I could not get it to work.
void getScreenResolution(int &w, int &h)
{
Regexp reWidth = regexp2 "ScreenWidth=([0-9]*)"
Regexp reHeight = regexp2 "ScreenHeight=([0-9]*)"
string sResult = ""
win32SystemWait_("cmd /c wmic desktopmonitor get screenheight, screenwidth /value >&2", sResult, -1)
if (reWidth sResult) w = intOf(sResult[match 1])
if (reHeight sResult) h = intOf(sResult[match 1])
}
int w = 0
int h = 0
getScreenResolution(w, h)
print "ScreenWidth = " w "\n"
print "ScreenHeight = " h "\n"
|
Re: DB window state Tony_Goodman - Tue Mar 05 05:07:18 EST 2013
My preferred approach would be to use COM, but I could not get it to work.
void getScreenResolution(int &w, int &h)
{
Regexp reWidth = regexp2 "ScreenWidth=([0-9]*)"
Regexp reHeight = regexp2 "ScreenHeight=([0-9]*)"
string sResult = ""
win32SystemWait_("cmd /c wmic desktopmonitor get screenheight, screenwidth /value >&2", sResult, -1)
if (reWidth sResult) w = intOf(sResult[match 1])
if (reHeight sResult) h = intOf(sResult[match 1])
}
int w = 0
int h = 0
getScreenResolution(w, h)
print "ScreenWidth = " w "\n"
print "ScreenHeight = " h "\n"
I tried this on a dialog and there is no guarantee that the dialog is centered on the screen, and I cannot get setPos() or setCenteredSize() to work properly.
void getScreenResolution(int &w, int &h)
{
Regexp reWidth = regexp2 "ScreenWidth=([0-9]*)"
Regexp reHeight = regexp2 "ScreenHeight=([0-9]*)"
string sResult = ""
win32SystemWait_("cmd /c wmic desktopmonitor get screenheight, screenwidth /value >&2", sResult, -1)
if (reWidth sResult) w = intOf(sResult[match 1])
if (reHeight sResult) h = intOf(sResult[match 1])
}
DB db = null
int w = 0, h = 0
getScreenResolution(w, h)
db = create("Resize")
realize(db)
setCenteredSize(db, w, h)
setPos(db, 0, 0)
show(db)
|
Re: DB window state Tony_Goodman - Tue Mar 05 05:20:35 EST 2013
I tried this on a dialog and there is no guarantee that the dialog is centered on the screen, and I cannot get setPos() or setCenteredSize() to work properly.
void getScreenResolution(int &w, int &h)
{
Regexp reWidth = regexp2 "ScreenWidth=([0-9]*)"
Regexp reHeight = regexp2 "ScreenHeight=([0-9]*)"
string sResult = ""
win32SystemWait_("cmd /c wmic desktopmonitor get screenheight, screenwidth /value >&2", sResult, -1)
if (reWidth sResult) w = intOf(sResult[match 1])
if (reHeight sResult) h = intOf(sResult[match 1])
}
DB db = null
int w = 0, h = 0
getScreenResolution(w, h)
db = create("Resize")
realize(db)
setCenteredSize(db, w, h)
setPos(db, 0, 0)
show(db)
see https://www.ibm.com/developerworks/forums/thread.jspa?messageID=14239123� setPos() does not work with zeroes. use setPos(db, 1, 1) and it works. Tony Goodman, www.smartdxl.com |
Re: DB window state Tony_Goodman - Tue Mar 05 05:55:18 EST 2013 Unfortunatly, WMIC.exe is restricted to admins on the pc here. I know it is possible to get the screen dimensions via automating Internet Explorer instead, but I recall there were the same problems with duel screens. I have been too busy to check wmi, as it is low,low,low priority. |
Re: DB window state SystemAdmin - Wed Mar 06 04:57:35 EST 2013
I remember I had to use the WMI from DXL once, so since COM does not seem to work, i think I wrote the vb script to a temp file, executed it via cscript /nologo ... and then parsed the output.
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
Set colItems = objWMIService.ExecQuery( _
"SELECT * FROM Win32_DesktopMonitor",,48)
For Each objItem in colItems
Wscript.Echo "-----------------------------------"
Wscript.Echo "Win32_DesktopMonitor instance"
Wscript.Echo "-----------------------------------"
Wscript.Echo "ScreenHeight: " & objItem.ScreenHeight
Wscript.Echo "ScreenWidth: " & objItem.ScreenWidth
Next
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|